import request from '@/utils/request'
export default {
  findAll(page, limit, searchObj) {
    return request({
      url: `/admin/pitfall/cpHitchManage/findAllCpHitch/${page}/${limit}`,
      method: 'get',
      params: searchObj,
    })
  },

  findAlls() {
    return request({
      url: `/admin/pitfall/cpHitchManage/findAllCpHitchs`,
      method: 'get',
    })
  },
  removeById(id) {
    return request({
      url: `/admin/pitfall/cpHitchManage/removeById/${id}`,
      method: 'delete',
    })
  },

  removeIds(idList) {
    return request({
      url: `/admin/pitfall/cpHitchManage/removeIds`,
      method: 'delete',
      data: idList,
    })
  },
  save(cpHitch) {
    return request({
      url: `/admin/pitfall/cpHitchManage/addCpHitchManager`,
      method: 'post',
      data: cpHitch,
    })
  },
  onUploadRemove(url) {
    return request({
      url: `http://localhost:8130/api/oss/file/removeFile?url=/${url}`,
      method: 'delete',
    })
  },
  //派发
  addCpHitchFlat(cpHitchFlat, id) {
    return request({
      url: `/admin/pitfall/cpHitchManage/addCpHitchFlat/${id}`,
      method: 'post',
      data: cpHitchFlat,
    })
  },
  //故障管理详情
  findCpHitchManagerById(id) {
    return request({
      url: `/admin/pitfall/cpHitchManage/findCpHitchManagerById/${id}`,
      method: 'get',
    })
  },
  //故障管理派发详情
  findHitchManagerFlatDetail(id) {
    return request({
      url: `/admin/pitfall/cpHitchManage/findHitchManagerFlatDetail/${id}`,
      method: 'get',
    })
  },
  //派发并将状态修改为1
  updateCpHitchStatusOne(cpHitch) {
    return request({
      url: `/admin/pitfall/cpHitchManage/updateCpHitchStatusOne`,
      method: 'put',
      data: cpHitch,
    })
  },
  //故障编辑
  cpHitchManagerUpdate(cpHitch) {
    return request({
      url: `/admin/pitfall/cpHitchManage/cpHitchManagerUpdate`,
      method: 'put',
      data: cpHitch,
    })
  },
  //接收
  cpHitchManagerStatusTwo(id) {
    return request({
      url: `/admin/pitfall/cpHitchManage/cpHitchManagerStatusTwo/${id}`,
      method: 'put',
    })
  },
  //办理
  addCpHitchDeal(cpHitchDeal, id) {
    return request({
      url: `/admin/pitfall/cpHitchManage/addCpHitchDeal/${id}`,
      method: 'post',
      data: cpHitchDeal,
    })
  },
  //办理并提交
  cpHitchManagerStatusFour(cpHitchDeal, id) {
    return request({
      url: `/admin/pitfall/cpHitchManage/cpHitchManagerStatusFour/${id}`,
      method: 'post',
      data: cpHitchDeal,
    })
  },
  //提交
  cpHitchManagerStatusFourSubmit(id) {
    return request({
      url: `/admin/pitfall/cpHitchManage/cpHitchManagerStatusFourSubmit/${id}`,
      method: 'put',
    })
  },
  //查看故障信息详情
  findCpHitchDealDetail(hitchId) {
    return request({
      url: `/admin/pitfall/cpHitchManage/findCpHitchDealDetail/${hitchId}`,
      method: 'get',
    })
  },
  //重新办理
  cpHitchManagerRegisterFirst(id) {
    return request({
      url: `/admin/pitfall/cpHitchManage/cpHitchManagerRegisterFirst/${id}`,
      method: 'put',
    })
  },
  //退回
  cpHitchManagerReturnFirst(cpHitch, id) {
    return request({
      url: `/admin/pitfall/cpHitchManage/cpHitchManagerReturnFirst/${id}`,
      method: 'put',
      data: cpHitch,
    })
  },
  //确认完成
  cpHitchManagerStatusFive(id) {
    return request({
      url: `/admin/pitfall/cpHitchManage/cpHitchManagerStatusFive/${id}`,
      method: 'put',
    })
  },
}
